const initState = {
  count: 1,
  xxx: '嘿嘿嘿',
}
export default function reducer(state = initState, action) {
  switch (action.type) {
    case 'add':
      return {
        ...state,
        count: state.count + action.payload,
      }
    case 'sub':
      return {
        ...state,
        count: state.count - action.payload,
      }
    case 'updateXxx':
      return {
        ...state,
        xxx: action.payload,
      }

    default:
      return state
  }
}
